home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2393 < prev    next >
Encoding:
Text File  |  1996-08-05  |  831 b   |  34 lines

  1. Path: su3.in.net!news
  2. From: poundss@in.net (Sam Pounds)
  3. Newsgroups: comp.lang.c
  4. Subject: Pointer Conversion
  5. Date: Sun, 21 Jan 1996 01:38:28 GMT
  6. Organization: INTERNET Indiana
  7. Message-ID: <4ds4jq$fo4@su3.in.net>
  8. NNTP-Posting-Host: pm1-05.in.net
  9. X-Newsreader: Forte Free Agent 1.0.82
  10.  
  11. I am having a problem with a "string concatenate" function.
  12. When I compile my little program it works, but I get a
  13. "suspicious pointer" conversion warning. The function is
  14. below and I call it with two strings that I want to concatenate.
  15.  
  16. char *my_strcat(const char *a, const char *b)
  17. {
  18.     char done[1024];
  19.     char *p = done;
  20.  
  21.     while (*a)
  22.       *p++ = *a++;
  23.     while (*b)
  24.       *p++ = *b++;
  25.     *p = '\0';
  26.     return done; /* this is the suspicious pointer conversion error */
  27. }
  28.  
  29. I'm sure someone can explain this to me.
  30. Thanks in advance.
  31.  
  32.  
  33.  
  34.